<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<%@page import="com.ckeditor.CKEditorConfig"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@ include file="/static/htm/head" %>
		<title>游戏论坛帖子专区</title>
	</head>
	<body style="font-size:15px;">
		<div style="text-align: center;">
			<a href="index.jsp">
				<img alt="论坛Logo" height="56" src="static/pic/logo.jpg" width="192">
			</a>
		</div>
		<table width="100%">
			<tr>
				<td>
					<a href="postlist?id=${param.id }">
						返回帖子列表
					</a>
				</td>
				<td style="text-align: right;">
					<%@ include file="/static/htm/user.jsp" %>
				</td>
			</tr>
		</table>
		<form action="permit/postproduct" method="post">
		<table style="position:relative;width:60%;left:20%;">
			<tr>
				<td>商品名称</td>
				<td><input type="text" name="productname" id="name"></td>
			</tr>
			<tr>
				<td>
				价格
				</td>
				<td>
					<input type="text" name="price" id="price"/>(商品价格单位是元，最多小数点后保存两位)
				</td>
			</tr>
			<tr>
				<td>
					收款财付通账号
				</td>
				<td>
					<input type="text" name="split_no" id="split_no">(<font color="red">*</font>请保证财付通账号正确无误)
				</td>
			</tr>
			<tr>
				<td  colspan="2">
					<div class="alert alert-error"  id="info">
					</div>
				</td>
			</tr>
			<tr>
				<td>
				</td>
				<td>
					<input id="submit" type="submit" value="生成发布连接" class="btn btn-success"> <span style="margin-left: 15px;"><a href="readme" target="_blank">论坛平台交易准则</a></span>
				</td>
			</tr>
		</table>
		<input type="hidden" name="id" value="${param.id }">
		</form>
		   <%@ include file="/static/htm/foot.jsp" %>	
	</body>
	<script type="text/javascript">
		$(document).ready(function(){
			function setInfo(info) {
				$("#info").html(info);
				$("#info").show();
			}
			function hideInfo() {
				$("#info").hide();
			}
			 hideInfo();
			$("#submit").click(function(){
				if($("#name").val() == ""){
					setInfo("商品名称不正确");
					return false;
				} else {
					var price = $("#price").val();
					var re = /^(\+)?\d+(\.\d{1,2})?$/;
					if(!re.test(price)){
						setInfo("商品价格输入不正确");
						return false;
					}
					if($("#split_no").val() == "") {
						setInfo("财付通收款账号不正确");
						return false;
					}
					return true;
				}
					
			});
		});
	</script>
</html>